﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DPS.Prototype.Model;
using DPS.Prototype.PolicyBase;

namespace DPS.Prototype.PolicyBase.Filters
{
    public abstract class WorkOrderFiltersBase
    {

        public List<WorkOrder> Filter(List<WorkOrder> matchedOrders, PolicyBase.ProdCompetitorBase prodCompetitor)
        {
            List<WorkOrder> orders = this.FilterProcess(matchedOrders, prodCompetitor);
            return orders.Count == 0&&this.IsOptional ? matchedOrders : orders;
        }

        protected abstract List<WorkOrder> FilterProcess(List<WorkOrder> matchedOrders, PolicyBase.ProdCompetitorBase prodCompetitor);

        public bool IsOptional { get; set; }

        public int OrderNo { get; set; }
    }
}
